package live.ciallo.discipline.pojo;

import lombok.Data;

@Data
public class Resoult<T> {

    private Integer code;

    private String message;

    private T data;

    public static <T> Resoult<T> success(T data) {
        Resoult<T> resoult = new Resoult<>();
        resoult.setCode(200);
        resoult.setMessage("success");
        resoult.setData(data);
        return resoult;
    }

    public static <T> Resoult<T> error(Integer code, String message) {
        Resoult<T> resoult = new Resoult<>();
        resoult.setCode(code);
        resoult.setMessage(message);
        return resoult;
    }
}
